Skip to content

Report config parsing errors ("invalid directive")#2179

Merged
jimklimov merged 1 commit intonetworkupstools:masterfrom
jimklimov:report-config-errors
Nov 15, 2023
Merged

Report config parsing errors ("invalid directive")#2179
jimklimov merged 1 commit intonetworkupstools:masterfrom
jimklimov:report-config-errors

Conversation

@jimklimov
Copy link
Copy Markdown
Member

When certain NUT daemons (upsd, upsmon, upssched; also snmp-ups with mib.conf files) initialize and parse their configuration, they used to just report seeing a certain parse error and it was not clear if the problem was considered fatal, or if the service proceeded to start.

With this PR, we report and count all such errors, and if the count was non-zero - issue a message to stress that some config entries were ignored but the program proceeds.

It feels reasonable to not start the mis-configured service as well, so the admins would fix it... But that may be a task for some other PR (e.g. consider an older daemon running against newer-syntax config files).

@jimklimov jimklimov added the service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug label Nov 14, 2023
@jimklimov jimklimov added this to the 2.8.2 milestone Nov 14, 2023
….c: report if config errors were seen and we ignored them (went on)

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov force-pushed the report-config-errors branch from c2b5a39 to c259a0a Compare November 14, 2023 14:02
@jimklimov jimklimov changed the title Report config parsing errors Report config parsing errors ("invalid directive") Nov 14, 2023
@jimklimov jimklimov merged commit 8dc9e72 into networkupstools:master Nov 15, 2023
@jimklimov jimklimov deleted the report-config-errors branch November 15, 2023 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant